package com.example.domain;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

public class ExcelListener extends AnalysisEventListener<Student> {

//    读取单行数据
    @Override
    public void invoke(Student student, AnalysisContext analysisContext) {
        System.out.println("该行数据为：" + student);
    }

//    读取表头
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头为：" + headMap);
    }

//    读取完成之后
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("Excel读取完毕");
    }
}
